package com.zdgcc.site.servlet;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zdgcc.site.util.Forward;

public class LoginServlet extends HttpServlet {

	private static final long serialVersionUID = -8531662972201340157L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response) {
		this.doPost(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) {

		String name = request.getParameter("name");
		String pwd = request.getParameter("pwd");

		request.getSession().setAttribute("name", name);
		System.out.println(name);
		System.out.println(pwd);
		Forward.doForward(request, response, path);
	}

	private final String path = "index.jsp";
}
